const debounce = () => {
  let timer = null;
  return function(fn, delay) {
    timer && clearTimeout(timer);
    timer = setTimeout(() => {
      fn();
    }, delay);
  };
};

export const debounceFunc = debounce();
